/*
 * @Author: guoyangf
 * @Date: 2020-06-22 13:39:47
 * @LastEditTime: 2020-08-04 13:49:00
 * @Description: file content
 */

import react, { Component } from 'react';
import { base } from 'nc-lightapp-front'
const { NCFormControl, NCTextArea } = base

import './index.less'
class ReasonCtrl extends Component {

    constructor(props) {
        super();
        this.state = {
            txtCount: props.handleReason.length
        }
    }

    render() {
        let timer = null;

        return (
            <div className={'reason-wrap'}>
                <NCFormControl
                    fieldid="reason"
                    value={this.props.handleReason}
                    onChange={(val) => {

                        this.props.setHandleReason(val);
                        this.setState({
                            txtCount: val.length
                        })

                    }}
                    maxLength={200}
                />
                <span className='txt-count'>{this.state.txtCount}/200</span>

            </div>

        )
    }
}

export default ReasonCtrl;
